<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OrangeCNC - ARISC firmware documentation: mod_encoder.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OrangeCNC - ARISC firmware documentation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mod__encoder_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">mod_encoder.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="mod__encoder_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef _MOD_ENCODER_H</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#define _MOD_ENCODER_H</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="mod__msg_8h.html">mod_msg.h</a>&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#ab01f0417d475385286c7e2ed25db2df6">   19</a></span>&#160;<span class="preprocessor">#define ENCODER_CH_CNT 8  </span></div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a529d576743c8f1445934b6388be2e537">   20</a></span>&#160;<span class="preprocessor">#define ENCODER_PH_CNT 3  </span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor"></span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html">   26</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structencoder__ch__t.html">encoder_ch_t</a></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;{</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html#a071e5007ca753b83d24505a6b6daba5c">   28</a></span>&#160;    uint8_t     <a class="code" href="structencoder__ch__t.html#a071e5007ca753b83d24505a6b6daba5c">enabled</a>;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html#a6f1249576f73ee4de5341db86bc46844">   29</a></span>&#160;    uint8_t     <a class="code" href="structencoder__ch__t.html#a6f1249576f73ee4de5341db86bc46844">using_B</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html#a194ff8527e51fd9226d3dfe87e57c728">   30</a></span>&#160;    uint8_t     <a class="code" href="structencoder__ch__t.html#a194ff8527e51fd9226d3dfe87e57c728">using_Z</a>;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html#a9068272b97c7b328f9a5f1f6d3d7e0ee">   32</a></span>&#160;    uint8_t     <a class="code" href="structencoder__ch__t.html#a9068272b97c7b328f9a5f1f6d3d7e0ee">port</a>[<a class="code" href="mod__encoder_8h.html#a529d576743c8f1445934b6388be2e537">ENCODER_PH_CNT</a>];</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html#a2ac4edfac489929becedee83885c73fd">   33</a></span>&#160;    uint32_t    <a class="code" href="structencoder__ch__t.html#a2ac4edfac489929becedee83885c73fd">pin_mask</a>[<a class="code" href="mod__encoder_8h.html#a529d576743c8f1445934b6388be2e537">ENCODER_PH_CNT</a>];</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html#a6ee97d98c992fa96d8667a2801139289">   34</a></span>&#160;    uint32_t    <a class="code" href="structencoder__ch__t.html#a6ee97d98c992fa96d8667a2801139289">state</a>[<a class="code" href="mod__encoder_8h.html#a529d576743c8f1445934b6388be2e537">ENCODER_PH_CNT</a>];</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html#ad81accb2d92fb90d570962574dbcb1ff">   36</a></span>&#160;    int32_t     <a class="code" href="structencoder__ch__t.html#ad81accb2d92fb90d570962574dbcb1ff">counts</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="structencoder__ch__t.html#a09dd655169a54f5e35529eea8eb42176">   37</a></span>&#160;    uint8_t     <a class="code" href="structencoder__ch__t.html#a09dd655169a54f5e35529eea8eb42176">AB_state</a>;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;};</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba571bba6d40429bb5f3c2c8ce45c65519">   43</a></span>&#160;<span class="keyword">enum</span> { <a class="code" href="mod__encoder_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba8825a1a26ae9bf551b490741d7ae280a">PHASE_A</a>, <a class="code" href="mod__encoder_8h.html#a06fc87d81c62e9abb8790b6e5713c55bac9590e77e32637ec7e053fe2690876bf">PHASE_B</a>, <a class="code" href="mod__encoder_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba571bba6d40429bb5f3c2c8ce45c65519">PHASE_Z</a> };</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#adf764cbdea00d65edcd07bb9953ad2b7a9df93864e0c663a143df712d3106208c">   44</a></span>&#160;<span class="keyword">enum</span> { <a class="code" href="mod__encoder_8h.html#adf764cbdea00d65edcd07bb9953ad2b7aa08b41e0b32514d9d1f48c60369a9668">PH_A</a>, <a class="code" href="mod__encoder_8h.html#adf764cbdea00d65edcd07bb9953ad2b7ab353e90859c9c82fefa0f281f660e44b">PH_B</a>, <a class="code" href="mod__encoder_8h.html#adf764cbdea00d65edcd07bb9953ad2b7a9df93864e0c663a143df712d3106208c">PH_Z</a> };</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">enum</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;{</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a45dfbc0d65eeec037718d8a04cda7d25">   49</a></span>&#160;    <a class="code" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a45dfbc0d65eeec037718d8a04cda7d25">ENCODER_MSG_PIN_SETUP</a> = 0x30,</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a8352d211b3265700c3f9fc31bab282ee">   50</a></span>&#160;    <a class="code" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a8352d211b3265700c3f9fc31bab282ee">ENCODER_MSG_SETUP</a>,</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a4daa0092415e82851b395a93a9134b8a">   51</a></span>&#160;    <a class="code" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a4daa0092415e82851b395a93a9134b8a">ENCODER_MSG_STATE_SET</a>,</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5af927605f0292235e9f81f184c98e814a">   52</a></span>&#160;    <a class="code" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5af927605f0292235e9f81f184c98e814a">ENCODER_MSG_STATE_GET</a>,</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a7f0292af39bc92d567e41163e2586263">   53</a></span>&#160;    <a class="code" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a7f0292af39bc92d567e41163e2586263">ENCODER_MSG_COUNTS_SET</a>,</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a5a8518f6c75332143ab3e7b29e2953f0">   54</a></span>&#160;    <a class="code" href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a5a8518f6c75332143ab3e7b29e2953f0">ENCODER_MSG_COUNTS_GET</a></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;};</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="mod__encoder_8h.html#a971a04d1eb01bc0e177aa6f9d4a03ea0">   58</a></span>&#160;<span class="preprocessor">#define ENCODER_MSG_BUF_LEN MSG_LEN</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="structencoder__msg__ch__t.html#aa03da43d2cb66a780d402267ce28013d">   61</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structencoder__msg__ch__t.html">encoder_msg_ch_t</a> { uint32_t <a class="code" href="structencoder__msg__ch__t.html#aa03da43d2cb66a780d402267ce28013d">ch</a>; };</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="structencoder__msg__pin__setup__t.html#a83a04ad582de2b7d36b96f9db429c2c6">   62</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structencoder__msg__pin__setup__t.html">encoder_msg_pin_setup_t</a> { uint32_t ch; uint32_t phase; uint32_t <a class="code" href="structencoder__msg__pin__setup__t.html#a83a04ad582de2b7d36b96f9db429c2c6">port</a>; uint32_t pin; };</div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="structencoder__msg__setup__t.html#a6cc33288f39ab2c9875f370610d356bd">   63</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structencoder__msg__setup__t.html">encoder_msg_setup_t</a> { uint32_t ch; uint32_t <a class="code" href="structencoder__ch__t.html#a6f1249576f73ee4de5341db86bc46844">using_B</a>; uint32_t <a class="code" href="structencoder__msg__setup__t.html#a6cc33288f39ab2c9875f370610d356bd">using_Z</a>; };</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structencoder__msg__state__set__t.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">   64</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structencoder__msg__state__set__t.html">encoder_msg_state_set_t</a> { uint32_t ch; uint32_t <a class="code" href="structencoder__msg__state__set__t.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a>; };</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="structencoder__msg__counts__set__t.html#ad81accb2d92fb90d570962574dbcb1ff">   65</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structencoder__msg__counts__set__t.html">encoder_msg_counts_set_t</a> { uint32_t ch; int32_t <a class="code" href="structencoder__msg__counts__set__t.html#ad81accb2d92fb90d570962574dbcb1ff">counts</a>; };</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="structencoder__msg__state__get__t.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">   66</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structencoder__msg__state__get__t.html">encoder_msg_state_get_t</a> { uint32_t <a class="code" href="structencoder__msg__state__get__t.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a>; };</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="structencoder__msg__counts__get__t.html#ad81accb2d92fb90d570962574dbcb1ff">   67</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structencoder__msg__counts__get__t.html">encoder_msg_counts_get_t</a> { int32_t <a class="code" href="structencoder__msg__counts__get__t.html#ad81accb2d92fb90d570962574dbcb1ff">counts</a>; };</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="comment">// export public methods</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__encoder_8h.html#a3e267babdd4cad47d79ea2dc77e05d22">encoder_module_init</a>();</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__encoder_8h.html#ac45cc4e8609d98b53513be7d101e2e92">encoder_module_base_thread</a>();</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__encoder_8h.html#aa9c08aae4548498e0ef296e28ff95139">encoder_pin_setup</a>(uint8_t c, uint8_t phase, uint8_t <a class="code" href="structencoder__ch__t.html#a9068272b97c7b328f9a5f1f6d3d7e0ee">port</a>, uint8_t pin);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__encoder_8h.html#ab19f3851f6b2768f91e08d066f15fa0c">encoder_setup</a>(uint8_t c, uint8_t <a class="code" href="structencoder__ch__t.html#a6f1249576f73ee4de5341db86bc46844">using_B</a>, uint8_t <a class="code" href="structencoder__ch__t.html#a194ff8527e51fd9226d3dfe87e57c728">using_Z</a>);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__encoder_8h.html#a1c121071467f9a1943fddc473873b7ed">encoder_state_set</a>(uint8_t c, uint8_t <a class="code" href="structencoder__ch__t.html#a6ee97d98c992fa96d8667a2801139289">state</a>);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__encoder_8h.html#a0e82c8d10ee1a0ef53521a8c7d4a0e23">encoder_counts_set</a>(uint8_t c, int32_t <a class="code" href="structencoder__ch__t.html#ad81accb2d92fb90d570962574dbcb1ff">counts</a>);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;uint8_t <a class="code" href="mod__encoder_8h.html#a377ac7de3373ddb7f8410560a2b7ad95">encoder_state_get</a>(uint8_t c);</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;int32_t <a class="code" href="mod__encoder_8h.html#a288e61e725e822b6827ff2052ad38c63">encoder_counts_get</a>(uint8_t c);</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;int8_t <span class="keyword">volatile</span> <a class="code" href="mod__encoder_8h.html#a3416779bfce857e32d619f9cb039138a">encoder_msg_recv</a>(uint8_t type, uint8_t * msg, uint8_t length);</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="structencoder__ch__t_html_a6ee97d98c992fa96d8667a2801139289"><div class="ttname"><a href="structencoder__ch__t.html#a6ee97d98c992fa96d8667a2801139289">encoder_ch_t::state</a></div><div class="ttdeci">uint32_t state[ENCODER_PH_CNT]</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:34</div></div>
<div class="ttc" id="structencoder__msg__pin__setup__t_html"><div class="ttname"><a href="structencoder__msg__pin__setup__t.html">encoder_msg_pin_setup_t</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:62</div></div>
<div class="ttc" id="mod__encoder_8h_html_a99fb83031ce9923c84392b4e92f956b5a4daa0092415e82851b395a93a9134b8a"><div class="ttname"><a href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a4daa0092415e82851b395a93a9134b8a">ENCODER_MSG_STATE_SET</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:51</div></div>
<div class="ttc" id="structencoder__ch__t_html_a194ff8527e51fd9226d3dfe87e57c728"><div class="ttname"><a href="structencoder__ch__t.html#a194ff8527e51fd9226d3dfe87e57c728">encoder_ch_t::using_Z</a></div><div class="ttdeci">uint8_t using_Z</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:30</div></div>
<div class="ttc" id="mod__encoder_8h_html_a0e82c8d10ee1a0ef53521a8c7d4a0e23"><div class="ttname"><a href="mod__encoder_8h.html#a0e82c8d10ee1a0ef53521a8c7d4a0e23">encoder_counts_set</a></div><div class="ttdeci">void encoder_counts_set(uint8_t c, int32_t counts)</div><div class="ttdoc">change number of counts for the selected channel </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:185</div></div>
<div class="ttc" id="mod__encoder_8h_html_aa9c08aae4548498e0ef296e28ff95139"><div class="ttname"><a href="mod__encoder_8h.html#aa9c08aae4548498e0ef296e28ff95139">encoder_pin_setup</a></div><div class="ttdeci">void encoder_pin_setup(uint8_t c, uint8_t phase, uint8_t port, uint8_t pin)</div><div class="ttdoc">setup encoder pin for the selected channel and phase </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:134</div></div>
<div class="ttc" id="structencoder__msg__state__set__t_html"><div class="ttname"><a href="structencoder__msg__state__set__t.html">encoder_msg_state_set_t</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:64</div></div>
<div class="ttc" id="mod__encoder_8h_html_a06fc87d81c62e9abb8790b6e5713c55ba8825a1a26ae9bf551b490741d7ae280a"><div class="ttname"><a href="mod__encoder_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba8825a1a26ae9bf551b490741d7ae280a">PHASE_A</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:43</div></div>
<div class="ttc" id="structencoder__ch__t_html_a2ac4edfac489929becedee83885c73fd"><div class="ttname"><a href="structencoder__ch__t.html#a2ac4edfac489929becedee83885c73fd">encoder_ch_t::pin_mask</a></div><div class="ttdeci">uint32_t pin_mask[ENCODER_PH_CNT]</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:33</div></div>
<div class="ttc" id="mod__encoder_8h_html_a3e267babdd4cad47d79ea2dc77e05d22"><div class="ttname"><a href="mod__encoder_8h.html#a3e267babdd4cad47d79ea2dc77e05d22">encoder_module_init</a></div><div class="ttdeci">void encoder_module_init()</div><div class="ttdoc">module init </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:57</div></div>
<div class="ttc" id="mod__encoder_8h_html_a99fb83031ce9923c84392b4e92f956b5a7f0292af39bc92d567e41163e2586263"><div class="ttname"><a href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a7f0292af39bc92d567e41163e2586263">ENCODER_MSG_COUNTS_SET</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:53</div></div>
<div class="ttc" id="mod__encoder_8h_html_a06fc87d81c62e9abb8790b6e5713c55bac9590e77e32637ec7e053fe2690876bf"><div class="ttname"><a href="mod__encoder_8h.html#a06fc87d81c62e9abb8790b6e5713c55bac9590e77e32637ec7e053fe2690876bf">PHASE_B</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:43</div></div>
<div class="ttc" id="structencoder__msg__ch__t_html_aa03da43d2cb66a780d402267ce28013d"><div class="ttname"><a href="structencoder__msg__ch__t.html#aa03da43d2cb66a780d402267ce28013d">encoder_msg_ch_t::ch</a></div><div class="ttdeci">uint32_t ch</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:61</div></div>
<div class="ttc" id="structencoder__msg__state__get__t_html"><div class="ttname"><a href="structencoder__msg__state__get__t.html">encoder_msg_state_get_t</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:66</div></div>
<div class="ttc" id="mod__encoder_8h_html_ab19f3851f6b2768f91e08d066f15fa0c"><div class="ttname"><a href="mod__encoder_8h.html#ab19f3851f6b2768f91e08d066f15fa0c">encoder_setup</a></div><div class="ttdeci">void encoder_setup(uint8_t c, uint8_t using_B, uint8_t using_Z)</div><div class="ttdoc">setup selected channel of encoder counter </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:157</div></div>
<div class="ttc" id="structencoder__ch__t_html_ad81accb2d92fb90d570962574dbcb1ff"><div class="ttname"><a href="structencoder__ch__t.html#ad81accb2d92fb90d570962574dbcb1ff">encoder_ch_t::counts</a></div><div class="ttdeci">int32_t counts</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:36</div></div>
<div class="ttc" id="mod__encoder_8h_html_a99fb83031ce9923c84392b4e92f956b5a8352d211b3265700c3f9fc31bab282ee"><div class="ttname"><a href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a8352d211b3265700c3f9fc31bab282ee">ENCODER_MSG_SETUP</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:50</div></div>
<div class="ttc" id="structencoder__msg__counts__set__t_html"><div class="ttname"><a href="structencoder__msg__counts__set__t.html">encoder_msg_counts_set_t</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:65</div></div>
<div class="ttc" id="mod__encoder_8h_html_adf764cbdea00d65edcd07bb9953ad2b7aa08b41e0b32514d9d1f48c60369a9668"><div class="ttname"><a href="mod__encoder_8h.html#adf764cbdea00d65edcd07bb9953ad2b7aa08b41e0b32514d9d1f48c60369a9668">PH_A</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:44</div></div>
<div class="ttc" id="mod__encoder_8h_html_a06fc87d81c62e9abb8790b6e5713c55ba571bba6d40429bb5f3c2c8ce45c65519"><div class="ttname"><a href="mod__encoder_8h.html#a06fc87d81c62e9abb8790b6e5713c55ba571bba6d40429bb5f3c2c8ce45c65519">PHASE_Z</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:43</div></div>
<div class="ttc" id="mod__encoder_8h_html_a99fb83031ce9923c84392b4e92f956b5a45dfbc0d65eeec037718d8a04cda7d25"><div class="ttname"><a href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a45dfbc0d65eeec037718d8a04cda7d25">ENCODER_MSG_PIN_SETUP</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:49</div></div>
<div class="ttc" id="mod__encoder_8h_html_adf764cbdea00d65edcd07bb9953ad2b7a9df93864e0c663a143df712d3106208c"><div class="ttname"><a href="mod__encoder_8h.html#adf764cbdea00d65edcd07bb9953ad2b7a9df93864e0c663a143df712d3106208c">PH_Z</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:44</div></div>
<div class="ttc" id="mod__encoder_8h_html_a3416779bfce857e32d619f9cb039138a"><div class="ttname"><a href="mod__encoder_8h.html#a3416779bfce857e32d619f9cb039138a">encoder_msg_recv</a></div><div class="ttdeci">int8_t volatile encoder_msg_recv(uint8_t type, uint8_t *msg, uint8_t length)</div><div class="ttdoc">&quot;message received&quot; callback </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:232</div></div>
<div class="ttc" id="structencoder__ch__t_html_a09dd655169a54f5e35529eea8eb42176"><div class="ttname"><a href="structencoder__ch__t.html#a09dd655169a54f5e35529eea8eb42176">encoder_ch_t::AB_state</a></div><div class="ttdeci">uint8_t AB_state</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:37</div></div>
<div class="ttc" id="structencoder__ch__t_html_a9068272b97c7b328f9a5f1f6d3d7e0ee"><div class="ttname"><a href="structencoder__ch__t.html#a9068272b97c7b328f9a5f1f6d3d7e0ee">encoder_ch_t::port</a></div><div class="ttdeci">uint8_t port[ENCODER_PH_CNT]</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:32</div></div>
<div class="ttc" id="structencoder__msg__setup__t_html"><div class="ttname"><a href="structencoder__msg__setup__t.html">encoder_msg_setup_t</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:63</div></div>
<div class="ttc" id="structencoder__msg__counts__set__t_html_ad81accb2d92fb90d570962574dbcb1ff"><div class="ttname"><a href="structencoder__msg__counts__set__t.html#ad81accb2d92fb90d570962574dbcb1ff">encoder_msg_counts_set_t::counts</a></div><div class="ttdeci">int32_t counts</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:65</div></div>
<div class="ttc" id="mod__msg_8h_html"><div class="ttname"><a href="mod__msg_8h.html">mod_msg.h</a></div><div class="ttdoc">ARM-ARISC message control module header. </div></div>
<div class="ttc" id="mod__encoder_8h_html_a1c121071467f9a1943fddc473873b7ed"><div class="ttname"><a href="mod__encoder_8h.html#a1c121071467f9a1943fddc473873b7ed">encoder_state_set</a></div><div class="ttdeci">void encoder_state_set(uint8_t c, uint8_t state)</div><div class="ttdoc">enable/disable selected channel of encoder counter </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:174</div></div>
<div class="ttc" id="mod__encoder_8h_html_a99fb83031ce9923c84392b4e92f956b5af927605f0292235e9f81f184c98e814a"><div class="ttname"><a href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5af927605f0292235e9f81f184c98e814a">ENCODER_MSG_STATE_GET</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:52</div></div>
<div class="ttc" id="structencoder__msg__counts__get__t_html_ad81accb2d92fb90d570962574dbcb1ff"><div class="ttname"><a href="structencoder__msg__counts__get__t.html#ad81accb2d92fb90d570962574dbcb1ff">encoder_msg_counts_get_t::counts</a></div><div class="ttdeci">int32_t counts</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:67</div></div>
<div class="ttc" id="structencoder__ch__t_html"><div class="ttname"><a href="structencoder__ch__t.html">encoder_ch_t</a></div><div class="ttdoc">a channel parameters </div><div class="ttdef"><b>Definition:</b> mod_encoder.h:26</div></div>
<div class="ttc" id="mod__encoder_8h_html_a288e61e725e822b6827ff2052ad38c63"><div class="ttname"><a href="mod__encoder_8h.html#a288e61e725e822b6827ff2052ad38c63">encoder_counts_get</a></div><div class="ttdeci">int32_t encoder_counts_get(uint8_t c)</div><div class="ttdoc">get current counts for the selected channel </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:211</div></div>
<div class="ttc" id="structencoder__ch__t_html_a071e5007ca753b83d24505a6b6daba5c"><div class="ttname"><a href="structencoder__ch__t.html#a071e5007ca753b83d24505a6b6daba5c">encoder_ch_t::enabled</a></div><div class="ttdeci">uint8_t enabled</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:28</div></div>
<div class="ttc" id="structencoder__ch__t_html_a6f1249576f73ee4de5341db86bc46844"><div class="ttname"><a href="structencoder__ch__t.html#a6f1249576f73ee4de5341db86bc46844">encoder_ch_t::using_B</a></div><div class="ttdeci">uint8_t using_B</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:29</div></div>
<div class="ttc" id="mod__encoder_8h_html_adf764cbdea00d65edcd07bb9953ad2b7ab353e90859c9c82fefa0f281f660e44b"><div class="ttname"><a href="mod__encoder_8h.html#adf764cbdea00d65edcd07bb9953ad2b7ab353e90859c9c82fefa0f281f660e44b">PH_B</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:44</div></div>
<div class="ttc" id="structencoder__msg__state__get__t_html_a1b0c7bd4d79798ef4e0ce23894c9aeb2"><div class="ttname"><a href="structencoder__msg__state__get__t.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">encoder_msg_state_get_t::state</a></div><div class="ttdeci">uint32_t state</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:66</div></div>
<div class="ttc" id="mod__encoder_8h_html_a99fb83031ce9923c84392b4e92f956b5a5a8518f6c75332143ab3e7b29e2953f0"><div class="ttname"><a href="mod__encoder_8h.html#a99fb83031ce9923c84392b4e92f956b5a5a8518f6c75332143ab3e7b29e2953f0">ENCODER_MSG_COUNTS_GET</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:54</div></div>
<div class="ttc" id="structencoder__msg__pin__setup__t_html_a83a04ad582de2b7d36b96f9db429c2c6"><div class="ttname"><a href="structencoder__msg__pin__setup__t.html#a83a04ad582de2b7d36b96f9db429c2c6">encoder_msg_pin_setup_t::port</a></div><div class="ttdeci">uint32_t port</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:62</div></div>
<div class="ttc" id="structencoder__msg__counts__get__t_html"><div class="ttname"><a href="structencoder__msg__counts__get__t.html">encoder_msg_counts_get_t</a></div><div class="ttdef"><b>Definition:</b> mod_encoder.h:67</div></div>
<div class="ttc" id="structencoder__msg__setup__t_html_a6cc33288f39ab2c9875f370610d356bd"><div class="ttname"><a href="structencoder__msg__setup__t.html#a6cc33288f39ab2c9875f370610d356bd">encoder_msg_setup_t::using_Z</a></div><div class="ttdeci">uint32_t using_Z</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:63</div></div>
<div class="ttc" id="structencoder__msg__ch__t_html"><div class="ttname"><a href="structencoder__msg__ch__t.html">encoder_msg_ch_t</a></div><div class="ttdoc">the message data access </div><div class="ttdef"><b>Definition:</b> mod_encoder.h:61</div></div>
<div class="ttc" id="mod__encoder_8h_html_a529d576743c8f1445934b6388be2e537"><div class="ttname"><a href="mod__encoder_8h.html#a529d576743c8f1445934b6388be2e537">ENCODER_PH_CNT</a></div><div class="ttdeci">#define ENCODER_PH_CNT</div><div class="ttdoc">number of encoder phases </div><div class="ttdef"><b>Definition:</b> mod_encoder.h:20</div></div>
<div class="ttc" id="mod__encoder_8h_html_a377ac7de3373ddb7f8410560a2b7ad95"><div class="ttname"><a href="mod__encoder_8h.html#a377ac7de3373ddb7f8410560a2b7ad95">encoder_state_get</a></div><div class="ttdeci">uint8_t encoder_state_get(uint8_t c)</div><div class="ttdoc">get state for the selected channel </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:201</div></div>
<div class="ttc" id="structencoder__msg__state__set__t_html_a1b0c7bd4d79798ef4e0ce23894c9aeb2"><div class="ttname"><a href="structencoder__msg__state__set__t.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">encoder_msg_state_set_t::state</a></div><div class="ttdeci">uint32_t state</div><div class="ttdef"><b>Definition:</b> mod_encoder.h:64</div></div>
<div class="ttc" id="mod__encoder_8h_html_ac45cc4e8609d98b53513be7d101e2e92"><div class="ttname"><a href="mod__encoder_8h.html#ac45cc4e8609d98b53513be7d101e2e92">encoder_module_base_thread</a></div><div class="ttdeci">void encoder_module_base_thread()</div><div class="ttdoc">module base thread </div><div class="ttdef"><b>Definition:</b> mod_encoder.c:73</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="mod__encoder_8h.html">mod_encoder.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
